package AdminRmi;

import java.rmi.Naming;
import java.rmi.RemoteException;
import POJO.*;

public class AdminRmi implements RmiInterface{
RmiInterface rmiInterface;
	
	public void init() {
		try {   
            String url = "//localhost:8806/SAMPLE-SERVER1";   
            rmiInterface = (RmiInterface) Naming.lookup(url);
        } catch (RemoteException rex) {   
            System.out.println("Error in lookup: " + rex.toString());   
        } catch (java.net.MalformedURLException me) {   
            System.out.println("Malformed URL: " + me.toString());   
        } catch (java.rmi.NotBoundException ne) {   
            System.out.println("NotBound: " + ne.toString());   
        }
	}
	
	public SignInStatePOJO findAdmin(SignInPOJO signInPOJO) {
		try {
			return rmiInterface.findAdmin(signInPOJO);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public DeleteCustomerStatePOJO deleteCustomer(int i) {
		try {
			return rmiInterface.deleteCustomer(i);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public CustomerListPOJO findCustomerList(int i) {
		try {
			return rmiInterface.findCustomerList(i);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public DeleteSaleManagerStatePOJO deleteSaleManager(int i) {
		try {
			return rmiInterface.deleteSaleManager(i);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public AddSaleManagerStatePOJO insertSaleManager(SaleManagerPOJO saleManagerPOJO) {
		try {
			return rmiInterface.insertSaleManager(saleManagerPOJO);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public ModifySaleManagerStatePOJO updateSaleManager(SaleManagerPOJO saleManagerPOJO) {
		try {
			return rmiInterface.updateSaleManager(saleManagerPOJO);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public SaleManagerPOJO findSaleManagerList(int i) {
		try {
			return rmiInterface.findSaleManagerList(i);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public DeleteManagerStatePOJO deleteManager(int i) {
		try {
			return rmiInterface.deleteManager(i);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public AddManagerStatePOJO insertManager(ManagerPOJO managerPOJO) {
		try {
			return rmiInterface.insertManager(managerPOJO);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public ModifyManagerStatePOJO modifyManager(ManagerPOJO managerPOJO) {
		try {
			return rmiInterface.modifyManager(managerPOJO);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public ManagerPOJO findManagerList(int i) {
		try {
			return rmiInterface.findManagerList(i);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public DeleteAdminStatePOJO deleteAdmin(int i) {
		try {
			return rmiInterface.deleteAdmin(i);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public AddAdminStatePOJO insertAdmin(AdminPOJO adminPOJO) {
		try {
			return rmiInterface.insertAdmin(adminPOJO);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public ModifyAdminStatePOJO modifyAdmin(AdminPOJO adminPOJO) {
		try {
			return rmiInterface.modifyAdmin(adminPOJO);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
	public AdminPOJO findAdminList(int i) {
		try {
			return rmiInterface.findAdminList(i);
		} catch (RemoteException e) {
			e.printStackTrace();
		}
		return null;
	}
}
